import { axios } from '@/utils/request'

const api = {
  apiListAddress: '/order/shippingAddress/listAddress',
  apiSaveShippingAddress: '/order/shippingAddress/save',
  apiSubmitOrder: '/order/submitOrder',
  apiGoPay: '/pay/goPay',
  apiPayResultVo: '/order/payResultVo'
}
export default api

export function apiSubmitOrder(parameter) {
  return axios({
    url: api.apiSubmitOrder,
    method: 'post',
    data: parameter
  })
}

export function apiSaveShippingAddress(parameter) {
  return axios({
    url: api.apiSaveShippingAddress,
    method: 'post',
    data: parameter
  })
}

export function apiListAddress() {
  return axios({
    url: api.apiListAddress,
    method: 'get'
  })
}

export function apiGoPay(parameter) {
  return axios({
    url: api.apiGoPay,
    method: 'get',
    params: parameter
  })
}

export function apiPayResultVo(parameter) {
  return axios({
    url: api.apiPayResultVo,
    method: 'get',
    params: parameter
  })
}